<script setup lang="ts">
 const btns=()=>{
  alert('你好彭于晏')
 }
 const onMouseenter=()=>{
console.log('移入')
 }
 const onMouseleave=()=>{
console.log('移出')
 }
</script>

<template>
<button @click="btns()">点击</button>
<div class="box" @mouseenter="onMouseenter()" @mouseleave="onMouseleave()">内容</div>
</template>
<style>
.box{
  width: 100px;
  height: 100px;
  background-color: red;
}
</style>